<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="js/vue.js"></script>
</head>
<body>
  <div id="app">
    {{fullName}}
  </div>
  <script>
    var app = new Vue({
      el: '#app',
      data() {
        return {
          firstname: 'jack',
          lastname: 'green'
        }
      },
      computed: {
        fullName: {
          get() {
            return this.firstname + ' ' + this.lastname;
          },
          set(newValue) {
            var names = newValue.split('  ');
            this.firstname = names[0];
            this.lastname = names[names.length - 1];
          }
        }
      }
    })
  </script>
</body>
</html>